//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#ifndef ___DRVPUB_H__
#define ___DRVPUB_H__

#if !defined(_RELEASE) || defined(_PRERELEASE)
//#define _DBGSCHIRQ
#endif

#if defined(_DBGSCHIRQ)
#define cprintf kprintf
#endif

#if !defined(_RELEASE) || defined(_PRERELEASE)
#define DRV_ASSERT_ENABLE // It should be not defined in the retail product
#endif

#ifdef DRV_ASSERT_ENABLE
INLINE void _DrvAssert(const char *szExpr, const char *szFile, int nLine)
{
    kprintf("Assertion failed: %s, file: %s, line: %d\n",
            szExpr, szFile, nLine);
    DebugBreak();
}

#define Drv_Assert(expr) \
    ((void)((expr) || (_DrvAssert(#expr, __FILE__, __LINE__), FALSE)))
#else
    #define Drv_Assert(expr)
#endif

EXTERN_C void * Drv_AllocBuffer(unsigned int uPages, unsigned int uFlag);
EXTERN_C void Drv_FreeBuffer(void * VirtAddr, unsigned int uPages);

#endif // ___DRVPUB_H__
